import request from '@/utils/request.js'

// 获取购物车列表
const getShopCartList = () => {
  return request({
    url: '/api/cart/cartList'
  })
}

// 删除购物车商品
const deleteCart = (skuId) => {
  return request({
    url: `/api/cart/deleteCart/${skuId}`,
    method: 'delete'
  })
}

// 切换商品选中状态
const updateCheckedById = (skuID, isChecked) => {
  return request({
    url: `/api/cart/checkCart/${skuID}/${isChecked}`
  })
}

export { getShopCartList, deleteCart, updateCheckedById }
